#include <jni.h>
#include <string>
#include <android/log.h>

const bool s_isCanPrintLog(true);

extern "C"
{
JNIEXPORT void JNICALL
Java_com_weigee_ktv_m_WeigeeKtv_printLog(JNIEnv *env, jclass, jstring tag_, jstring msg_) {
    if (msg_ != NULL && &s_isCanPrintLog) {
        const bool isTagNull(tag_ == NULL);
        const char *printTag;

        if (isTagNull) {
            printTag = "LinDe";
        } else {
            printTag = env->GetStringUTFChars(tag_, 0);
        }
        const char *message = env->GetStringUTFChars(msg_, 0);

        __android_log_print(ANDROID_LOG_ERROR, printTag, message, NULL);

        if (!isTagNull) {
            env->ReleaseStringUTFChars(tag_, printTag);
        }
        env->ReleaseStringUTFChars(msg_, message);
    }
}
JNIEXPORT jstring JNICALL
Java_com_weigee_ktv_m_WeigeeKtv_pgyAppId(JNIEnv *env, jclass) {

    const char *returnValue("87e76dbcf1b58f2cf269ffdd2e924f7d");
    return env->NewStringUTF(returnValue);
}
JNIEXPORT jstring JNICALL
Java_com_weigee_ktv_m_WeigeeKtv_umengAppId(JNIEnv *env, jclass) {
    return env->NewStringUTF("58db6b9db27b0a43020016c1");
}
JNIEXPORT jstring JNICALL
Java_com_weigee_ktv_m_WeigeeKtv_umengAppChannel(JNIEnv *env, jclass) {
    return env->NewStringUTF("tysci");
}
JNIEXPORT jint JNICALL
Java_com_weigee_ktv_m_WeigeeKtv_pageLength(JNIEnv, jclass) {
    return 10;
}

}